{% extends "intest/base.html" %}
{% block title %}测试报告{% endblock %}
{% load staticfiles %}
{% block css %}
{% endblock %}
{% block js %}
{% endblock %}
{% block content %}
    <div class="panel panel-default">
        <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>编号</th>
                  <th>名称</th>
                  <th>类型</th>
                  <th>错误</th>
                  <th>创建时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              {% for report in reportList %}
                <tr>
                  <td>{{ report.id}}</td>
                  <td>{{ report.report_html }}</td>
                  <td>{{ report.job_name}}</td>
                  <td>{{ report.fail_count}}</td>
                  <td>{{ report.create_time}}</td>
                  <td>
                      <a href="{{ report_dir }}{{ report.report_html }}" target="_blank">
                          <button class="btn btn-primary btn-xs">查看</button>
                      </a>
                      <!--a href="deleteReport?delete={{ log.log_id }}">
                          <button class="btn btn-danger btn-xs">删除</button>
                      </11a-->

                  </td>
                </tr>
              {% endfor %}
              </tbody>
            </table>
          </div>
        <ul class="pagination" id="pager">
                {#上一页按钮开始#}
                {# 如果当前页有上一页#}
                {% if reportList.has_previous %}
                    {#  当前页的上一页按钮正常使用#}
                    <li class="previous"><a href="/intest/report?page={{ reportList.previous_page_number }}">&laquo;</a></li>
                {% else %}
                    {# 当前页的不存在上一页时,上一页的按钮不可用#}
                    <li class="previous disabled"><a href="#">&laquo;</a></li>
                {% endif %}
                {#上一页按钮结束#}
                {# 页码开始#}
                {% for num in paginator.page_range %}

                    {% if num == currentPage %}
                        <li class="item active"><a href="/intest/report?page={{ num }}">{{ num }}</a></li>
                    {% else %}
                        <li class="item"><a href="/intest/report?page={{ num }}">{{ num }}</a></li>

                    {% endif %}
                {% endfor %}
                {#页码结束#}
                {# 下一页按钮开始#}
                {% if reportList.has_next %}
                    <li class="next"><a href="/intest/report?page={{ reportList.next_page_number }}">&raquo;</a></li>
                {% else %}
                    <li class="next disabled"><a href="#">&raquo;</a></li>
                {% endif %}
                {# 下一页按钮结束#}
            </ul>
    </div>
{% endblock %}